Optimal. Leaf size=34 \[ -\frac {a \cot ^2(e+f x)}{2 f}-\frac {(a-b) \log (\sin (e+f x))}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3710, 12, 3556}
\begin {gather*} -\frac {(a-b) \log (\sin (e+f x))}{f}-\frac {a \cot ^2(e+f x)}{2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 3556
Rule 3710
Rubi steps
\begin {align*} \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=-\frac {a \cot ^2(e+f x)}{2 f}-\int (a-b) \cot (e+f x) \, dx\\ &=-\frac {a \cot ^2(e+f x)}{2 f}-(a-b) \int \cot (e+f x) \, dx\\ &=-\frac {a \cot ^2(e+f x)}{2 f}-\frac {(a-b) \log (\sin (e+f x))}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 56, normalized size = 1.65 \begin {gather*} \frac {b (\log (\cos (e+f x))+\log (\tan (e+f x)))}{f}-\frac {a \left (\cot ^2(e+f x)+2 \log (\cos (e+f x))+2 \log (\tan (e+f x))\right )}{2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 37, normalized size = 1.09
method | result | size |
derivativedivides | \(\frac {b \ln \left (\sin \left (f x +e \right )\right )+a \left (-\frac {\left (\cot ^{2}\left (f x +e \right )\right )}{2}-\ln \left (\sin \left (f x +e \right )\right )\right )}{f}\) | \(37\) |
default | \(\frac {b \ln \left (\sin \left (f x +e \right )\right )+a \left (-\frac {\left (\cot ^{2}\left (f x +e \right )\right )}{2}-\ln \left (\sin \left (f x +e \right )\right )\right )}{f}\) | \(37\) |
norman | \(-\frac {a}{2 f \tan \left (f x +e \right )^{2}}-\frac {\left (a -b \right ) \ln \left (\tan \left (f x +e \right )\right )}{f}+\frac {\left (a -b \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}\) | \(54\) |
risch | \(i x a -i x b +\frac {2 i a e}{f}-\frac {2 i b e}{f}+\frac {2 a \,{\mathrm e}^{2 i \left (f x +e \right )}}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2}}-\frac {a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}{f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) b}{f}\) | \(91\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 33, normalized size = 0.97 \begin {gather*} -\frac {{\left (a - b\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac {a}{\sin \left (f x + e\right )^{2}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.41, size = 66, normalized size = 1.94 \begin {gather*} -\frac {{\left (a - b\right )} \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} + a \tan \left (f x + e\right )^{2} + a}{2 \, f \tan \left (f x + e\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 100 vs.
\(2 (27) = 54\).
time = 0.74, size = 100, normalized size = 2.94 \begin {gather*} \begin {cases} \tilde {\infty } a x & \text {for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\left (e \right )}\right ) \cot ^{3}{\left (e \right )} & \text {for}\: f = 0 \\\frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac {a \log {\left (\tan {\left (e + f x \right )} \right )}}{f} - \frac {a}{2 f \tan ^{2}{\left (e + f x \right )}} - \frac {b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b \log {\left (\tan {\left (e + f x \right )} \right )}}{f} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 165 vs.
\(2 (34) = 68\).
time = 0.78, size = 165, normalized size = 4.85 \begin {gather*} -\frac {4 \, {\left (a - b\right )} \log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right ) - 8 \, {\left (a - b\right )} \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right ) - \frac {{\left (a + \frac {4 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {4 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}}{\cos \left (f x + e\right ) - 1} - \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}}{8 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.62, size = 54, normalized size = 1.59 \begin {gather*} \frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a}{2}-\frac {b}{2}\right )}{f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a-b\right )}{f}-\frac {a\,{\mathrm {cot}\left (e+f\,x\right )}^2}{2\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________